#include <stdio.h>
#include <stdlib.h>


struct userData {
    char name[20];
    unsigned char age;
    float math;
    float eng;
};
typedef struct userData uData_t;

int A[100];
int*  ptrInt=NULL;
char*  ptrChar=NULL;

int main(){

    
    float* ptrFloat=NULL;
    uData_t* ptrUData=NULL;
    

    printf("sizeof char = %d\n", sizeof(char));
    printf("sizeof short = %d\n", sizeof(short));
    printf("sizeof int = %d\n", sizeof(int));
    printf("sizeof long = %d\n", sizeof(long));
    printf("sizeof float = %d\n", sizeof(float));
    printf("sizeof double = %d\n", sizeof(double));
    printf("sizeof array = %d\n", sizeof(A));
    printf("sizeof struct userData= %d\n", sizeof(struct userData));
    printf("sizeof uData_t = %d\n", sizeof(uData_t));
    
    printf("sizeof int pointer var = %d, %d\n", sizeof(ptrInt), sizeof(int *));
    printf("sizeof char pointer var = %d, %d\n", sizeof(ptrChar), sizeof(char *));
    printf("sizeof float pointer var = %d, %d\n", sizeof(ptrFloat), sizeof(float *));
    printf("sizeof uData pointer var = %d, %d\n", sizeof(ptrUData), sizeof(uData_t *));


    ptrInt = (int *) malloc(sizeof(ptrInt));
    ptrChar = (char *) malloc(sizeof(ptrChar));
    ptrFloat = (float *) malloc(sizeof(float));
    ptrUData = (uData_t *) malloc(sizeof(uData_t));

    printf("sizeof int pointer var point to = %d, %p\n", sizeof(*ptrInt), ptrInt);
    printf("sizeof char pointer var point to= %d, %p\n", sizeof(*ptrChar), ptrChar);
    printf("sizeof float pointer var point to= %d, %p\n", sizeof(*ptrFloat), ptrFloat);
    printf("sizeof uData pointer var point to= %d, %p\n", sizeof(*ptrUData), ptrUData);

    printf("address of ptrUData->name = %p\n", ptrUData->name);
    printf("address of ptrUData->age = %p\n", &ptrUData->age);
    printf("address of ptrUData->math = %p\n", &ptrUData->math);
    printf("address of ptrUData->eng = %p\n", &ptrUData->eng);

}